const HtmlWebpackPlugin = require('html-webpack-plugin')


module.exports = {
  entry: {
    app: './src/app.js',
  },
  output: {
    filename: '[name].bundle.js',
    path: __dirname + '/dist',
  },
  mode: 'development',
  resolve: {
    alias: {
      crypto: false,
      stream: false,
      assert: false,
      http: false,
      https: false,
      fs: false,
      path:  false,
      os: false,
      zlib:false,
      tls: false, 
      net: false
    }
  },
  devServer: {
   port: 9000,
   hot: true
  },
  module : {
    rules: [
      {
        test: /\.m?js$/,
        exclude: /(node_modules|browser_components)/,
        use: {
          loader: 'babel-loader',
          options: {
            presets: ['@babel/preset-env']
          }
        }
      }
    ]
  },
  plugins: [
    new HtmlWebpackPlugin({
      template: 'index.html',
     }),
  ]
};